<html>
	<head>
		<script>
			var xsl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"><xsl:template match=\"/\"><xsl:apply-templates/></xsl:template><xsl:template match=\"por_un_clavo\"><ul><xsl:apply-templates/></ul></xsl:template><xsl:template match=\"linea\"><li><xsl:value-of select=\".\"/></li></xsl:template></xsl:stylesheet>";
			var xml;

			var reader = new FileReader();

			reader.onload = function(event) {
				xml = event.target.result;
				parsearXml();
			}

			reader.onerror = function(event) {
				alert("Error leyendo el archivo, code: " + reader.error.code);		
			} 

			function procesarXml() {
				if (document.getElementById("ficheroxml").files.length == 0) { return; }  
				var fichero = document.getElementById("ficheroxml").files[0];  
				reader.readAsText(fichero);  
			}

			function parsearXml() {
				var xsltProcessor = new XSLTProcessor();
				var parser = new DOMParser();
				xsltProcessor.importStylesheet(parser.parseFromString(xsl, "text/xml"));
				var resultDocument = xsltProcessor.transformToFragment(parser.parseFromString(xml, "text/xml"), document);				
				document.getElementById("resultado").appendChild(resultDocument); 
			}
		</script>
	</head>
	<body>
		<input id="ficheroxml" type="file" name="ficheroxml" onchange="procesarXml();"/>
		<div id="resultado">
		</div>
	</body>
</html>